From bd7e7d1dd60aa2351d62bb096cd0db423aa9256f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Wed, 30 Jul 2014 23:46:13 +0200 Subject: [PATCH] inspector: Make the action editor more useful We were not finding the action owner for menuitems, we have to try harder to walk all the way up to the window. --- gtk/inspector/prop-editor.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/gtk/inspector/prop-editor.c b/gtk/inspector/prop-editor.c index 2e78da9713..3b19e8161e 100644 --- a/gtk/inspector/prop-editor.c +++ b/gtk/inspector/prop-editor.c @@ -1253,22 +1253,20 @@ find_action_owner (GtkActionable *actionable) if (g_strcmp0 (prefix, "win") == 0) { if (G_IS_OBJECT (win)) - return (GObject *)win; + return (GObject *)win; } else if (g_strcmp0 (prefix, "app") == 0) { if (GTK_IS_WINDOW (win)) return (GObject *)gtk_window_get_application (GTK_WINDOW (win)); } - else + + while (widget != NULL) { - while (widget != NULL) - { - group = _gtk_widget_get_action_group (widget, prefix); - if (group && g_action_group_has_action (group, name)) - return (GObject *)widget; - widget = action_ancestor (widget); - } + group = _gtk_widget_get_action_group (widget, prefix); + if (group && g_action_group_has_action (group, name)) + return (GObject *)widget; + widget = action_ancestor (widget); } return NULL; -- 2.30.2